package org.fightingliu.demo.repository.es.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @author : LiuChao
 * @description : TODO
 * @date : 2025-04-13 17:36:14
 */
@Data
@Document(indexName = "user_#{new java.text.SimpleDateFormat(\"yyyyMM\").format(new java.util.Date())}")
public class User {
    /**
     * 主键id
     */
    @Id
    private String id;
    /**
     * 用户id
     */
    @Field(type = FieldType.Keyword)
    private String userId;
    /**
     * 用户姓名
     */
    @Field(type =FieldType.Keyword)
    private String userName;
    /**
     * 生日
     */
    @Field(type = FieldType.Date)
    private Date birthday;
    /**
     * 部门id
     */
    @Field(type = FieldType.Keyword)
    private String departmentId;
    /**
     * 邮箱
     */
    @Field(type = FieldType.Text)
    private String email;
    /**
     * 密码
     */
    private String password;
    /**
     * 手机号
     */
    @Field(type =FieldType.Keyword)
    private String phoneNumber;

    /**
     * 用户状态
     */
    @Field(type =FieldType.Keyword)
    private String status;
    /**
     * 备注
     */
    @Field(type =FieldType.Text)
    private String remark;
}
